package tests;

import junit.framework.TestCase;
import modelo.Coordenada;

public class CoordenadaTest extends TestCase{

	public void testCoordenada(){
		Coordenada coord = new Coordenada();
		assertEquals(0,coord.getX());
		assertEquals(0,coord.getY());
	}
	
	public void testCordenadaConParametros(){
		Coordenada coord = new Coordenada(5,12);
		assertEquals(5,coord.getX());
		assertEquals(12,coord.getY());
	}
	
	public void testSetParametros(){
		Coordenada coord = new Coordenada();
		coord.setCoordenadas(8,70);
		assertEquals(8,coord.getX());
		assertEquals(70,coord.getY());
	}
	
	public void testMoverCoordenadas(){
		Coordenada coord = new Coordenada(5,12);
		coord.moverCoordenadas(2,-1);
		assertEquals(7,coord.getX());
		assertEquals(11,coord.getY());
	}
	
	public void testEquals(){
		Coordenada unaCoord = new Coordenada(6,7);
		Coordenada otraCoord = new Coordenada(6,7);
		assertTrue(unaCoord.equals(otraCoord));
		otraCoord.setCoordenadas(4,2);
		assertFalse(unaCoord.equals(otraCoord));
	}
	
	public void testToString(){
		Coordenada coord = new Coordenada(7,12);
		assertEquals("( 7 , 12 )",coord.toString());
	}
}
